package com.example.broadcastreceiver;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Button sendButton=findViewById(R.id.sendButton);
        sendButton.setOnClickListener(new BroadcastListener());
    }
    class BroadcastListener implements View.OnClickListener{

        @Override
        public void onClick(View v) {
            Intent intent=new Intent();
            intent.setAction(Intent.ACTION_EDIT);
            MainActivity.this.sendBroadcast(intent);

        }
    }
}
